//Media Link
function playmedia(playIcon, strID,strURL,intWidth,intHeight) {

	playIcon.replace(" ","%20");
	strID.replace(" ","%20");
	
	var objDiv=document.getElementById(strID);
	document.getElementById(playIcon).style.display='none';
	
	if (!objDiv) return false;
	if (objDiv.style.display!='none') {
		objDiv.innerHTML='';
		objDiv.style.display='none';
	} else {
		objDiv.innerHTML=makemedia(strURL,intWidth,intHeight);
		objDiv.style.display='block';
	}
}

//Media Build
function makemedia (strURL,intWidth,intHeight) {
	var strHtml;
	
	strHtml ="<object id='MediaPlayer1' width='"+ intWidth +"' height='"+ intHeight +"' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' align='baseline' border='0' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>";
	strHtml+="<param name='invokeURLs' value='0'>";
    	strHtml+="<param name='FileName' value=\""+ strURL +"\">";
    	strHtml+="<param name='ShowControls' value='1'>";
    	strHtml+="<param name='ShowPositionControls' value='0'>";
    	strHtml+="<param name='ShowAudioControls' value='1'>";
    	strHtml+="<param name='ShowTracker' value='1'>";
    	strHtml+="<param name='ShowDisplay' value='0'>";
    	strHtml+="<param name='ShowStatusBar' value='1'>";
    	strHtml+="<param name='AutoSize' value='0'>";
    	strHtml+="<param name='ShowGotoBar' value='0'>";
    	strHtml+="<param name='ShowCaptioning' value='0'>";
    	strHtml+="<param name='AutoStart' value='1'>";
    	strHtml+="<param name='PlayCount' value='0'>";
    	strHtml+="<param name='AnimationAtStart' value='0'>";
    	strHtml+="<param name='TransparentAtStart' value='0'>";
    	strHtml+="<param name='AllowScan' value='0'>";
    	strHtml+="<param name='EnableContextMenu' value='1'>";
    	strHtml+="<param name='ClickToPlay' value='0'>";
    	strHtml+="<param name='DefaultFrame' value='datawindow'>";
	
	
	strHtml+="<embed src=\""+ strURL +"\" align='baseline' border='0' width='"+ intWidth +"' height='"+ intHeight +"' type='application/x-mplayer2'";
        strHtml+=" pluginspage='http://www.microsoft.com/isapi/redir.dll?prd=windows&amp;sbp=mediaplayer&amp;ar=media&amp;sba=plugin&amp;'";
        strHtml+="name='MediaPlayer' showcontrols='1' showpositioncontrols='0' showaudiocontrols='1' showtracker='1' showdisplay='0' showstatusbar='1' autosize='0' showgotobar='0' showcaptioning='0' autostart='1' autorewind='0'";
        strHtml+="animationatstart='0' transparentatstart='0' allowscan='1' enablecontextmenu='1' clicktoplay='0' defaultframe='datawindow' invokeurls='0'> </embed></object>";
        
     
	return strHtml;
}



//again begin

function GetSongType(md5code)
{
	switch(md5code)
	{
		case "7d99bb4c7bd4602c342e2bb826ee8777":
			return ".wma";
			break;
		case "25e4f07f5123910814d9b8f3958385ba":
			return ".Wma";
			break;
		case "51bbd020689d1ce1c845a484995c0cce":
			return ".WMA";
			break;
		case "b3a7a4e64bcd8aabe4cabe0e55b57af5":
			return ".mp3";
			break;
		case "d82029f73bcaf052be8930f6f4247184":
			return ".MP3";
			break;
		case "5fd91d90d9618feca4740ac1f2e7948f":
			return ".Mp3";
			break;
	}	
}

//Media Link
function playmedia1(playIcon, strID,strURL,intWidth,intHeight,type, Head) {

	playIcon.replace(" ","%20");
	strID.replace(" ","%20");
	
	var objDiv=document.getElementById(strID);
	document.getElementById(playIcon).style.display='none';
	
	if (!objDiv) return false;
	if (objDiv.style.display!='none') {
		objDiv.innerHTML='';
		objDiv.style.display='none';
	} else {
		objDiv.innerHTML=makemedia1(strURL,intWidth,intHeight, type, Head);
		objDiv.style.display='block';
	}
}

//Media Build
function makemedia1 (strURL,intWidth,intHeight, type, Head) {
	var strHtml;
	var SongUrl = Head + strURL + GetSongType(type);
	
	strHtml ="<object id='MediaPlayer1' width='"+ intWidth +"' height='"+ intHeight +"' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' align='baseline' border='0' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>";
	strHtml+="<param name='invokeURLs' value='0'>";
    	strHtml+="<param name='FileName' value=\""+ SongUrl +"\">";
    	strHtml+="<param name='ShowControls' value='1'>";
    	strHtml+="<param name='ShowPositionControls' value='0'>";
    	strHtml+="<param name='ShowAudioControls' value='1'>";
    	strHtml+="<param name='ShowTracker' value='1'>";
    	strHtml+="<param name='ShowDisplay' value='0'>";
    	strHtml+="<param name='ShowStatusBar' value='1'>";
    	strHtml+="<param name='AutoSize' value='0'>";
    	strHtml+="<param name='ShowGotoBar' value='0'>";
    	strHtml+="<param name='ShowCaptioning' value='0'>";
    	strHtml+="<param name='AutoStart' value='1'>";
    	strHtml+="<param name='PlayCount' value='0'>";
    	strHtml+="<param name='AnimationAtStart' value='0'>";
    	strHtml+="<param name='TransparentAtStart' value='0'>";
    	strHtml+="<param name='AllowScan' value='0'>";
    	strHtml+="<param name='EnableContextMenu' value='1'>";
    	strHtml+="<param name='ClickToPlay' value='0'>";
    	strHtml+="<param name='DefaultFrame' value='datawindow'>";
	
	
	strHtml+="<embed src=\""+ SongUrl +"\" align='baseline' border='0' width='"+ intWidth +"' height='"+ intHeight +"' type='application/x-mplayer2'";
        strHtml+=" pluginspage='http://www.microsoft.com/isapi/redir.dll?prd=windows&amp;sbp=mediaplayer&amp;ar=media&amp;sba=plugin&amp;'";
        strHtml+="name='MediaPlayer' showcontrols='1' showpositioncontrols='0' showaudiocontrols='1' showtracker='1' showdisplay='0' showstatusbar='1' autosize='0' showgotobar='0' showcaptioning='0' autostart='1' autorewind='0'";
        strHtml+="animationatstart='0' transparentatstart='0' allowscan='1' enablecontextmenu='1' clicktoplay='0' defaultframe='datawindow' invokeurls='0'> </embed></object>";
        
     
	return strHtml;
}